package org.harsh.transmission.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.harsh.transmission.mapper.TransMsgMapper;
import org.harsh.transmission.domain.TransMsg;
import org.harsh.transmission.service.ITransMsgService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;

/**
 * 传输消息Service业务层处理
 * 
 * @author liuhaibo
 * @date 2024-08-25
 */
@Service
public class TransMsgServiceImpl implements ITransMsgService 
{
    @Autowired
    private TransMsgMapper transMsgMapper;

    /**
     * 查询传输消息
     * 
     * @param msgId 传输消息主键
     * @return 传输消息
     */
    @Override
    public TransMsg selectTransMsgByMsgId(Long msgId)
    {
        return transMsgMapper.selectTransMsgByMsgId(msgId);
    }

    /**
     * 查询传输消息列表
     * 
     * @param transMsg 传输消息
     * @return 传输消息
     */
    @Override
    public List<TransMsg> selectTransMsgList(TransMsg transMsg)
    {
        return transMsgMapper.selectTransMsgList(transMsg);
    }

    /**
     * 新增传输消息
     * 
     * @param transMsg 传输消息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertTransMsg(TransMsg transMsg)
    {
        return transMsgMapper.insertTransMsg(transMsg);
    }

    /**
     * 修改传输消息
     * 
     * @param transMsg 传输消息
     * @return 结果
     */
    @Override
    @Transactional
    public int updateTransMsg(TransMsg transMsg)
    {
        return transMsgMapper.updateTransMsg(transMsg);
    }

    /**
     * 批量删除传输消息
     * 
     * @param msgIds 需要删除的传输消息主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteTransMsgByMsgIds(String msgIds)
    {
        return transMsgMapper.deleteTransMsgByMsgIds(Convert.toStrArray(msgIds));
    }

    /**
     * 删除传输消息信息
     * 
     * @param msgId 传输消息主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteTransMsgByMsgId(Long msgId)
    {
        return transMsgMapper.deleteTransMsgByMsgId(msgId);
    }
}
